<template>
  <div class="box6">
    <div class="title">
      <p>客流量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
let charts = ref()

onMounted(() => {
  let myCharts = echarts.init(charts.value)
  myCharts.setOption({
    title: {
      text: '散点图',
      textStyle: {
        color: 'white',
      },
      left: '40%',
    },
    xAxis: {
      type: 'category',
      axisLine: {
        show: true,
        lineStyle: {
          color: 'white',
        },
      },
      //show:false,
    },
    yAxis: {
      //show:false,
      axisLine: {
        show: true,
        lineStyle: {
          color: 'white',
        },
      },
      splitLine: {
        show: false,
      },
    },
    series: {
      type: 'scatter',
      data: [
        33, 88, 21, 332, 124, 21, 13, 14, 16, 30, 20, 1100, 20, 547, 76, 46, 242, 143, 12, 41, 15,
        17,
      ],
      symbol: 'diamond',
      //标签配置
      label: {
        show: true,
        position: 'top',
        color: 'white',
      },
      //散点图标记
      itemStyle: {
        color: {
          tyle: 'linear',
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [
            {
              offset: 0,
              color: 'orange',
            },
            {
              offset: 1,
              color: 'rgb(1,52,129)',
            },
          ],
          global: false,
        },
      },
    },
  })
})
</script>

<style scoped lang="scss">
.box6 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;
  margin: 5px 0px;
  .title {
    margin-top: 10px;
    margin-left: 20px;
    color: white;
    font-size: 18px;
  }

  .charts {
    width: 100%;
    height: 100%;
  }
}
</style>
